1 Import Data

We obtained data in the form of a phyloseq data object from the Human Genome Project (HMP) that was previously processed for taxanomic identification of microbial organisms. We then cleaned and processed the data further for statistical analysis.

1.1 Clean sample data

The 4743 samples in the HMP were obtained from multiple individuals (2555 males and 2188 females), processed by several locations, and in some cases repeated samples were taken from the same individual. We subset the data to ensure independence by limiting samples from one location and only the first visit. Additionally, we removed samples noted as “Mislabeled” or “Contaminated”. After removing samples using these criteria, we were left with 609 samples.

##    RUNCENTER Mislabeled Contaminated visitno   n
## 1       JCVI      FALSE        FALSE       1 609
## 2        BCM      FALSE        FALSE       2 583
## 3         BI      FALSE        FALSE       1 538
## 4       WUGC      FALSE        FALSE       1 518
## 5       WUGC         NA           NA       1 513
## 6       WUGC      FALSE        FALSE       2 473
## 7       JCVI      FALSE        FALSE       2 400
## 8         BI      FALSE        FALSE       2 380
## 9         BI         NA           NA       1 160
## 10    BCM,BI         NA           NA       1  85
## 11 JCVI,WUGC         NA           NA       1  79
## 12   JCVI,BI         NA           NA       1  75
## 13       BCM      FALSE        FALSE       1  73
## 14  BCM,WUGC      FALSE        FALSE       1  49
## 15  BCM,WUGC         NA           NA       1  41
## 16      WUGC         NA           NA       2  26
## 17       BCM         NA           NA       1  25
## 18  BCM,JCVI      FALSE        FALSE       1  23
## 19  BCM,JCVI      FALSE        FALSE       2  17
## 20       BCM      FALSE        FALSE       3  15
## 21 JCVI,WUGC      FALSE        FALSE       1  14
## 22    BCM,BI      FALSE        FALSE       2  12
## 23      WUGC      FALSE        FALSE       3   9
## 24    BI,BCM         NA           NA       1   7
## 25    BCM,BI      FALSE        FALSE       1   6
## 26    BI,BCM      FALSE        FALSE       2   6
## 27  WUGC,BCM      FALSE        FALSE       1   5
## 28  WUGC,BCM         NA           NA       1   1
## 29 WUGC,JCVI         NA           NA       1   1
## [1] "Dropped 4134 samples after cleaning."

2 Rarefaction

We rarefied the data to control for uneven sampling efforts Sanders, H. L. (1968), Willis, A.D. (2019).

##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       1    2679    3577    3863    4696   29969
## phyloseq-class experiment-level object
## otu_table()   OTU Table:         [ 24839 taxa and 562 samples ]
## sample_data() Sample Data:       [ 562 samples by 8 sample variables ]
## tax_table()   Taxonomy Table:    [ 24839 taxa by 7 taxonomic ranks ]
## phy_tree()    Phylogenetic Tree: [ 24839 tips and 24650 internal nodes ]
## refseq()      DNAStringSet:      [ 24839 reference sequences ]

3 Plot pre- and post-rarefaction

Check the number of reads before and after rarefaction.

4 Alpha-diversity

We calculated alpha diversity scores, a measure of number of unique organisms within a single sample, using the indices Shannon, Simpson, Phylogenetic, and Richness (Whittaker 1960). Each calculates alpha-diversity using slightly different mathematical approaches to measure evenness (distribution of organisms) and/or richness (number of organismss). If differences in results are seen between indices, this can reveal insights into which kinds of organisms are present (e.g., common vs rare).

## [1] "Calculating non-phylogenetic alpha scores..."
## Warning in `[.data.table`(tmp.dt, , `:=`(se.chao1, NULL)): Column 'se.chao1'
## does not exist to remove
## [1] "Calculating phylogenetic alpha scores..."

5 Fit linear model

We fit the data using linear model to predict alpha-diversity score as a function of body sub-site, sex, or their interaction.

5.1 Check assumptions

To assess if the assumptions of linear model regression were met, we visually inspected residuals vs fitted values, standardized residuals vs quantiles, standardized residuals vs fitted values and residuals vs leverage for each diversity index. In general, Residuals vs fitted appears slightly heteroscedasticity, Q-Q plots show that the data slightly deviates from the diagonal line indicating that the data may be non-normal, Scale-location plots show that std. residuals are negatively associated with fitted values indicating heteroscedasticity, and there are several points with high leverage, but none that appear to have too high. The plots associated with the Simpson’s index appear to be significantly heteroscedastic and non-normal.

5.1.1 Shannon

## Warning: not plotting observations with leverage one:
##   234

5.1.2 Simpson

## Warning: not plotting observations with leverage one:
##   234

5.1.3 Phylogenetic

## Warning: not plotting observations with leverage one:
##   234

5.1.4 Richness

## Warning: not plotting observations with leverage one:
##   234

6 Remove unusual observations

The previous plots revealed that the data is largely consistent, but there are some inconsistencies in variance and non-normality for some of the alpha indices. To correct for this, we applied case influence statistics to remove any unusually influential and leveraged samples. We removed any samples using cutoffs of 2p/n (p is the number of unknown parameters in the model) for leverage, 1 for Cook’s Distance and above 2 or below -2 for standardized residuals.

From the original 562 samples, we removed 45, 54, 33, and 31 unusual observations in the Shannon, Simpson, Phylogenetic and Richness indices, respectively.

7 Fit refined model

After removing the unusual samples, we refit the data to a linear model.

# Refined model

### Statisticians use rough cutoffs of 2p/n (p is the number of unknown parameters in the model) for leverage, 
#     1 for Cook’s Distance and above 2 or below -2 for standardized residuals. 
#     Observations falling outside these ranges warrant further attention.

caseInfStats[["cutoff.lev"]] <- lapply(methods.alpha, function(alpha){
  cutOff.lev <- (2 * length(caseInfStats$mod.unref[[alpha]][["coefficients"]]) / 
                   nrow(caseInfStats$dataFort.unref[[alpha]]))
})


caseInfStats[["dataFort.sub"]] <- lapply(methods.alpha, function(alpha){
  caseInfStats$dataFort.unref[[alpha]]  %>%
    dplyr::filter(Lev < caseInfStats[["cutoff.lev"]][[alpha]]) %>%  # Leverage Cut off
    dplyr::filter(StdResid < 2 & StdResid > -2 ) %>%  # StdResid Cut Off
    dplyr::select(obs_num:Alpha.Score)  # Removes the old case statistic influence data
})


# make refined model
caseInfStats[["mod.ref"]] <- lapply(methods.alpha, function(alpha){
  lm( formula = "Alpha.Score ~ sex*HMPbodysubsite",
       data = caseInfStats[["dataFort.sub"]][[alpha]]
      )
})


# Fortify data for plotting
caseInfStats[["dataFort.ref"]] <- lapply(methods.alpha, function(alpha){
  fortify(caseInfStats$mod.ref[[alpha]], caseInfStats[["dataFort.sub"]][[alpha]])
})

# Rename some column names
lapply(methods.alpha, function(alpha){
  setnames(caseInfStats$dataFort.ref[[alpha]], 
           old=c(".hat", ".cooksd", ".stdresid"), 
           new=c("Lev", "CooksD", "StdResid"))
})


# Refinded model Plot

caseInfStats[["ref.plot"]] <- lapply(names(methods.alpha), function(alpha){
  tmp.data <- caseInfStats[["dataFort.ref"]]
  qplot(obs_num, value, data = reshape::melt(tmp.data[[alpha]][, c("obs_num","Lev", "CooksD", "StdResid")],
    id.vars = "obs_num")) + 
    geom_point(aes(color = variable)) +
    facet_grid(variable ~ ., scale = "free_y") + 
    labs(title = paste0("Case-influence statistics plot: Refined model (", alpha,")")) + 
    scale_color_brewer(palette = "Dark2") + 
    theme(legend.position = "none") + scale_x_continuous(breaks = scales::breaks_pretty(10))

}) 

names(caseInfStats[["ref.plot"]]) <- names(methods.alpha)

7.2 Plot unrefined and refined models

## $Shannon

## 
## $Simpson

## 
## $Phylogenetic

## 
## $Richness

8 Results of linear model

8.1 Shannon

## Anova Table (Type II tests)
## 
## Response: Alpha.Score
##                     Sum Sq  Df F value    Pr(>F)    
## sex                  2.139   1 12.3088 0.0004925 ***
## HMPbodysubsite     252.107  15 96.7150 < 2.2e-16 ***
## sex:HMPbodysubsite   5.719  12  2.7425 0.0013018 ** 
## Residuals           84.804 488                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## We fitted a linear model (estimated using OLS) to predict Alpha.Score with sex and HMPbodysubsite (formula: Alpha.Score ~ sex * HMPbodysubsite). The model explains a statistically significant and substantial proportion of variance (R2 = 0.77, F(28, 488) = 57.88, p < .001, adj. R2 = 0.76). The model's intercept, corresponding to sex = female and HMPbodysubsite = Anterior_nares, is at 4.52 (95% CI [4.28, 4.77], t(488) = 36.00, p < .001). Within this model:
## 
##   - The effect of sex [male] is statistically non-significant and positive (beta = 0.05, 95% CI [-0.29, 0.38], t(488) = 0.26, p = 0.792; Std. beta = 0.05, 95% CI [-0.34, 0.45])
##   - The effect of HMPbodysubsite [Attached Keratinized gingiva] is statistically significant and negative (beta = -0.51, 95% CI [-0.82, -0.20], t(488) = -3.25, p = 0.001; Std. beta = -0.60, 95% CI [-0.97, -0.24])
##   - The effect of HMPbodysubsite [Buccal mucosa] is statistically significant and negative (beta = -0.52, 95% CI [-0.85, -0.19], t(488) = -3.14, p = 0.002; Std. beta = -0.62, 95% CI [-1.00, -0.23])
##   - The effect of HMPbodysubsite [Hard palate] is statistically non-significant and negative (beta = -0.16, 95% CI [-0.47, 0.16], t(488) = -0.98, p = 0.326; Std. beta = -0.19, 95% CI [-0.56, 0.19])
##   - The effect of HMPbodysubsite [Left Retroauricular crease] is statistically significant and negative (beta = -0.95, 95% CI [-1.28, -0.62], t(488) = -5.64, p < .001; Std. beta = -1.12, 95% CI [-1.52, -0.73])
##   - The effect of HMPbodysubsite [Mid vagina] is statistically significant and negative (beta = -1.11, 95% CI [-1.43, -0.79], t(488) = -6.88, p < .001; Std. beta = -1.32, 95% CI [-1.69, -0.94])
##   - The effect of HMPbodysubsite [Palatine Tonsils] is statistically significant and positive (beta = 0.61, 95% CI [0.31, 0.91], t(488) = 3.97, p < .001; Std. beta = 0.72, 95% CI [0.36, 1.08])
##   - The effect of HMPbodysubsite [Posterior fornix] is statistically significant and negative (beta = -1.43, 95% CI [-1.75, -1.11], t(488) = -8.78, p < .001; Std. beta = -1.70, 95% CI [-2.08, -1.32])
##   - The effect of HMPbodysubsite [Right Retroauricular crease] is statistically significant and negative (beta = -0.93, 95% CI [-1.26, -0.61], t(488) = -5.64, p < .001; Std. beta = -1.11, 95% CI [-1.49, -0.72])
##   - The effect of HMPbodysubsite [Saliva] is statistically significant and positive (beta = 0.92, 95% CI [0.62, 1.22], t(488) = 6.01, p < .001; Std. beta = 1.09, 95% CI [0.73, 1.45])
##   - The effect of HMPbodysubsite [Stool] is statistically significant and positive (beta = 0.42, 95% CI [0.11, 0.74], t(488) = 2.65, p = 0.008; Std. beta = 0.50, 95% CI [0.13, 0.87])
##   - The effect of HMPbodysubsite [Subgingival plaque] is statistically significant and positive (beta = 0.93, 95% CI [0.63, 1.23], t(488) = 6.06, p < .001; Std. beta = 1.10, 95% CI [0.74, 1.46])
##   - The effect of HMPbodysubsite [Supragingival plaque] is statistically significant and positive (beta = 0.92, 95% CI [0.61, 1.23], t(488) = 5.84, p < .001; Std. beta = 1.09, 95% CI [0.73, 1.46])
##   - The effect of HMPbodysubsite [Throat] is statistically significant and positive (beta = 0.52, 95% CI [0.22, 0.82], t(488) = 3.37, p < .001; Std. beta = 0.62, 95% CI [0.26, 0.98])
##   - The effect of HMPbodysubsite [Tongue dorsum] is statistically non-significant and positive (beta = 0.19, 95% CI [-0.12, 0.50], t(488) = 1.21, p = 0.228; Std. beta = 0.23, 95% CI [-0.14, 0.59])
##   - The effect of HMPbodysubsite [Vaginal introitus] is statistically significant and negative (beta = -1.28, 95% CI [-1.60, -0.97], t(488) = -8.04, p < .001; Std. beta = -1.52, 95% CI [-1.89, -1.15])
##   - The interaction effect of HMPbodysubsite [Attached Keratinized gingiva] on sex [male] is statistically non-significant and positive (beta = 0.16, 95% CI [-0.27, 0.59], t(488) = 0.74, p = 0.460; Std. beta = 0.19, 95% CI [-0.32, 0.70])
##   - The interaction effect of HMPbodysubsite [Buccal mucosa] on sex [male] is statistically non-significant and positive (beta = 0.34, 95% CI [-0.10, 0.77], t(488) = 1.51, p = 0.132; Std. beta = 0.40, 95% CI [-0.12, 0.92])
##   - The interaction effect of HMPbodysubsite [Hard palate] on sex [male] is statistically significant and positive (beta = 0.69, 95% CI [0.25, 1.13], t(488) = 3.06, p = 0.002; Std. beta = 0.82, 95% CI [0.29, 1.34])
##   - The interaction effect of HMPbodysubsite [Left Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 0.11, 95% CI [-0.39, 0.60], t(488) = 0.43, p = 0.665; Std. beta = 0.13, 95% CI [-0.46, 0.72])
##   - The interaction effect of HMPbodysubsite [Mid vagina] on sex [male] is statistically non-significant and negative (beta = -0.14, 95% CI [-0.55, 0.28], t(488) = -0.65, p = 0.519; Std. beta = -0.16, 95% CI [-0.66, 0.33])
##   - The interaction effect of HMPbodysubsite [Palatine Tonsils] on sex [male] is statistically non-significant and negative (beta = -0.13, 95% CI [-0.61, 0.34], t(488) = -0.55, p = 0.579; Std. beta = -0.16, 95% CI [-0.72, 0.40])
##   - The interaction effect of HMPbodysubsite [Posterior fornix] on sex [male] is statistically non-significant and positive (beta = 0.03, 95% CI [-0.39, 0.44], t(488) = 0.13, p = 0.900; Std. beta = 0.03, 95% CI [-0.46, 0.53])
##   - The interaction effect of HMPbodysubsite [Right Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 0.13, 95% CI [-0.30, 0.56], t(488) = 0.60, p = 0.550; Std. beta = 0.16, 95% CI [-0.36, 0.67])
##   - The interaction effect of HMPbodysubsite [Saliva] on sex [male] is statistically non-significant and negative (beta = -0.16, 95% CI [-0.58, 0.26], t(488) = -0.76, p = 0.447; Std. beta = -0.19, 95% CI [-0.69, 0.30])
##   - The interaction effect of HMPbodysubsite [Stool] on sex [male] is statistically non-significant and negative (beta = -0.09, 95% CI [-0.52, 0.33], t(488) = -0.42, p = 0.671; Std. beta = -0.11, 95% CI [-0.61, 0.39])
##   - The interaction effect of HMPbodysubsite [Subgingival plaque] on sex [male] is statistically non-significant and positive (beta = 0.10, 95% CI [-0.32, 0.52], t(488) = 0.46, p = 0.642; Std. beta = 0.12, 95% CI [-0.38, 0.62])
##   - The interaction effect of HMPbodysubsite [Supragingival plaque] on sex [male] is statistically non-significant and positive (beta = 0.25, 95% CI [-0.18, 0.67], t(488) = 1.14, p = 0.255; Std. beta = 0.29, 95% CI [-0.21, 0.80])
##   - The interaction effect of HMPbodysubsite [Tongue dorsum] on sex [male] is statistically non-significant and positive (beta = 0.05, 95% CI [-0.29, 0.38], t(488) = 0.26, p = 0.792; Std. beta = 0.05, 95% CI [-0.34, 0.45])
##   - The interaction effect of HMPbodysubsite [Vaginal introitus] on sex [male] is statistically significant and negative (beta = -0.51, 95% CI [-0.82, -0.20], t(488) = -3.25, p = 0.001; Std. beta = -0.60, 95% CI [-0.97, -0.24])
## 
## Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using the Wald approximation.
## The ANOVA suggests that:
## 
##   - The main effect of sex is statistically significant and small (F(1, 488) = 12.31, p < .001; Eta2 (partial) = 0.02, 95% CI [6.98e-03, 1.00])
##   - The main effect of HMPbodysubsite is statistically significant and large (F(15, 488) = 96.72, p < .001; Eta2 (partial) = 0.75, 95% CI [0.72, 1.00])
##   - The interaction between sex and HMPbodysubsite is statistically significant and medium (F(12, 488) = 2.74, p = 0.001; Eta2 (partial) = 0.06, 95% CI [0.01, 1.00])
## 
## Effect sizes were labelled following Field's (2013) recommendations.

8.2 Simpson

## Anova Table (Type II tests)
## 
## Response: Alpha.Score
##                     Sum Sq  Df F value Pr(>F)    
## sex                0.00170   1  2.1934 0.1393    
## HMPbodysubsite     0.72782  15 62.5740 <2e-16 ***
## sex:HMPbodysubsite 0.00851  12  0.9150 0.5315    
## Residuals          0.37143 479                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## We fitted a linear model (estimated using OLS) to predict Alpha.Score with sex and HMPbodysubsite (formula: Alpha.Score ~ sex * HMPbodysubsite). The model explains a statistically significant and substantial proportion of variance (R2 = 0.68, F(28, 479) = 35.74, p < .001, adj. R2 = 0.66). The model's intercept, corresponding to sex = female and HMPbodysubsite = Anterior_nares, is at 0.96 (95% CI [0.95, 0.98], t(479) = 119.76, p < .001). Within this model:
## 
##   - The effect of sex [male] is statistically non-significant and positive (beta = 0.01, 95% CI [-0.01, 0.03], t(479) = 1.00, p = 0.320; Std. beta = 0.23, 95% CI [-0.23, 0.69])
##   - The effect of HMPbodysubsite [Attached Keratinized gingiva] is statistically significant and negative (beta = -0.02, 95% CI [-0.04, -2.78e-03], t(479) = -2.24, p = 0.025; Std. beta = -0.47, 95% CI [-0.88, -0.06])
##   - The effect of HMPbodysubsite [Buccal mucosa] is statistically significant and negative (beta = -0.04, 95% CI [-0.06, -0.02], t(479) = -3.89, p < .001; Std. beta = -0.85, 95% CI [-1.28, -0.42])
##   - The effect of HMPbodysubsite [Hard palate] is statistically non-significant and negative (beta = -0.01, 95% CI [-0.03, 7.01e-03], t(479) = -1.28, p = 0.200; Std. beta = -0.28, 95% CI [-0.70, 0.15])
##   - The effect of HMPbodysubsite [Left Retroauricular crease] is statistically significant and negative (beta = -0.04, 95% CI [-0.06, -0.02], t(479) = -3.47, p < .001; Std. beta = -0.79, 95% CI [-1.23, -0.34])
##   - The effect of HMPbodysubsite [Mid vagina] is statistically significant and negative (beta = -0.11, 95% CI [-0.13, -0.08], t(479) = -8.63, p < .001; Std. beta = -2.31, 95% CI [-2.83, -1.78])
##   - The effect of HMPbodysubsite [Palatine Tonsils] is statistically non-significant and positive (beta = 0.02, 95% CI [-1.22e-03, 0.04], t(479) = 1.84, p = 0.066; Std. beta = 0.38, 95% CI [-0.03, 0.79])
##   - The effect of HMPbodysubsite [Posterior fornix] is statistically significant and negative (beta = -0.18, 95% CI [-0.21, -0.16], t(479) = -13.92, p < .001; Std. beta = -3.87, 95% CI [-4.42, -3.33])
##   - The effect of HMPbodysubsite [Right Retroauricular crease] is statistically significant and negative (beta = -0.04, 95% CI [-0.07, -0.02], t(479) = -4.12, p < .001; Std. beta = -0.93, 95% CI [-1.38, -0.49])
##   - The effect of HMPbodysubsite [Saliva] is statistically significant and positive (beta = 0.03, 95% CI [6.55e-03, 0.05], t(479) = 2.63, p = 0.009; Std. beta = 0.55, 95% CI [0.14, 0.96])
##   - The effect of HMPbodysubsite [Stool] is statistically non-significant and positive (beta = 0.02, 95% CI [-1.17e-03, 0.04], t(479) = 1.85, p = 0.065; Std. beta = 0.40, 95% CI [-0.02, 0.83])
##   - The effect of HMPbodysubsite [Subgingival plaque] is statistically significant and positive (beta = 0.03, 95% CI [8.72e-03, 0.05], t(479) = 2.84, p = 0.005; Std. beta = 0.59, 95% CI [0.18, 1.00])
##   - The effect of HMPbodysubsite [Supragingival plaque] is statistically significant and positive (beta = 0.03, 95% CI [8.03e-03, 0.05], t(479) = 2.75, p = 0.006; Std. beta = 0.59, 95% CI [0.17, 1.02])
##   - The effect of HMPbodysubsite [Throat] is statistically non-significant and positive (beta = 0.01, 95% CI [-5.30e-03, 0.03], t(479) = 1.43, p = 0.152; Std. beta = 0.30, 95% CI [-0.11, 0.71])
##   - The effect of HMPbodysubsite [Tongue dorsum] is statistically non-significant and positive (beta = 1.05e-03, 95% CI [-0.02, 0.02], t(479) = 0.10, p = 0.919; Std. beta = 0.02, 95% CI [-0.40, 0.45])
##   - The effect of HMPbodysubsite [Vaginal introitus] is statistically significant and negative (beta = -0.14, 95% CI [-0.16, -0.11], t(479) = -11.33, p < .001; Std. beta = -2.92, 95% CI [-3.43, -2.42])
##   - The interaction effect of HMPbodysubsite [Attached Keratinized gingiva] on sex [male] is statistically non-significant and negative (beta = -8.50e-03, 95% CI [-0.04, 0.02], t(479) = -0.60, p = 0.549; Std. beta = -0.18, 95% CI [-0.76, 0.41])
##   - The interaction effect of HMPbodysubsite [Buccal mucosa] on sex [male] is statistically non-significant and positive (beta = 5.67e-03, 95% CI [-0.02, 0.03], t(479) = 0.40, p = 0.692; Std. beta = 0.12, 95% CI [-0.47, 0.71])
##   - The interaction effect of HMPbodysubsite [Hard palate] on sex [male] is statistically non-significant and positive (beta = 0.01, 95% CI [-0.02, 0.04], t(479) = 0.90, p = 0.369; Std. beta = 0.28, 95% CI [-0.33, 0.88])
##   - The interaction effect of HMPbodysubsite [Left Retroauricular crease] on sex [male] is statistically non-significant and negative (beta = -7.27e-03, 95% CI [-0.04, 0.02], t(479) = -0.45, p = 0.653; Std. beta = -0.15, 95% CI [-0.82, 0.52])
##   - The interaction effect of HMPbodysubsite [Mid vagina] on sex [male] is statistically non-significant and negative (beta = -0.02, 95% CI [-0.04, 0.01], t(479) = -1.13, p = 0.257; Std. beta = -0.33, 95% CI [-0.91, 0.24])
##   - The interaction effect of HMPbodysubsite [Palatine Tonsils] on sex [male] is statistically non-significant and negative (beta = -9.88e-03, 95% CI [-0.04, 0.02], t(479) = -0.64, p = 0.525; Std. beta = -0.21, 95% CI [-0.85, 0.43])
##   - The interaction effect of HMPbodysubsite [Posterior fornix] on sex [male] is statistically non-significant and negative (beta = -0.01, 95% CI [-0.04, 0.02], t(479) = -0.78, p = 0.438; Std. beta = -0.23, 95% CI [-0.80, 0.35])
##   - The interaction effect of HMPbodysubsite [Right Retroauricular crease] on sex [male] is statistically non-significant and negative (beta = -0.02, 95% CI [-0.04, 0.01], t(479) = -1.06, p = 0.291; Std. beta = -0.32, 95% CI [-0.91, 0.27])
##   - The interaction effect of HMPbodysubsite [Saliva] on sex [male] is statistically non-significant and negative (beta = -0.01, 95% CI [-0.04, 0.01], t(479) = -1.05, p = 0.293; Std. beta = -0.31, 95% CI [-0.89, 0.27])
##   - The interaction effect of HMPbodysubsite [Stool] on sex [male] is statistically non-significant and negative (beta = -0.01, 95% CI [-0.04, 0.01], t(479) = -0.91, p = 0.362; Std. beta = -0.27, 95% CI [-0.86, 0.31])
##   - The interaction effect of HMPbodysubsite [Subgingival plaque] on sex [male] is statistically non-significant and negative (beta = -0.01, 95% CI [-0.04, 0.02], t(479) = -0.75, p = 0.454; Std. beta = -0.22, 95% CI [-0.80, 0.36])
##   - The interaction effect of HMPbodysubsite [Supragingival plaque] on sex [male] is statistically non-significant and negative (beta = -1.73e-03, 95% CI [-0.03, 0.03], t(479) = -0.12, p = 0.903; Std. beta = -0.04, 95% CI [-0.62, 0.55])
##   - The interaction effect of HMPbodysubsite [Tongue dorsum] on sex [male] is statistically non-significant and positive (beta = 0.01, 95% CI [-0.01, 0.03], t(479) = 1.00, p = 0.320; Std. beta = 0.23, 95% CI [-0.23, 0.69])
##   - The interaction effect of HMPbodysubsite [Vaginal introitus] on sex [male] is statistically significant and negative (beta = -0.02, 95% CI [-0.04, -2.78e-03], t(479) = -2.24, p = 0.025; Std. beta = -0.47, 95% CI [-0.88, -0.06])
## 
## Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using the Wald approximation.
## The ANOVA suggests that:
## 
##   - The main effect of sex is statistically not significant and very small (F(1, 479) = 2.19, p = 0.139; Eta2 (partial) = 4.56e-03, 95% CI [0.00, 1.00])
##   - The main effect of HMPbodysubsite is statistically significant and large (F(15, 479) = 62.57, p < .001; Eta2 (partial) = 0.66, 95% CI [0.62, 1.00])
##   - The interaction between sex and HMPbodysubsite is statistically not significant and small (F(12, 479) = 0.92, p = 0.532; Eta2 (partial) = 0.02, 95% CI [0.00, 1.00])
## 
## Effect sizes were labelled following Field's (2013) recommendations.

8.3 Phylogenetic

## Anova Table (Type II tests)
## 
## Response: Alpha.Score
##                    Sum Sq  Df  F value    Pr(>F)    
## sex                  22.3   1   3.9495  0.047430 *  
## HMPbodysubsite     9391.5  15 110.8586 < 2.2e-16 ***
## sex:HMPbodysubsite  172.8  12   2.5503  0.002794 ** 
## Residuals          2823.9 500                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## We fitted a linear model (estimated using OLS) to predict Alpha.Score with sex and HMPbodysubsite (formula: Alpha.Score ~ sex * HMPbodysubsite). The model explains a statistically significant and substantial proportion of variance (R2 = 0.78, F(28, 500) = 63.68, p < .001, adj. R2 = 0.77). The model's intercept, corresponding to sex = female and HMPbodysubsite = Anterior_nares, is at 10.15 (95% CI [8.80, 11.50], t(500) = 14.80, p < .001). Within this model:
## 
##   - The effect of sex [male] is statistically non-significant and negative (beta = -1.36, 95% CI [-3.26, 0.55], t(500) = -1.40, p = 0.163; Std. beta = -0.27, 95% CI [-0.66, 0.11])
##   - The effect of HMPbodysubsite [Attached Keratinized gingiva] is statistically non-significant and negative (beta = -0.77, 95% CI [-2.44, 0.91], t(500) = -0.90, p = 0.368; Std. beta = -0.16, 95% CI [-0.49, 0.18])
##   - The effect of HMPbodysubsite [Buccal mucosa] is statistically significant and positive (beta = 2.47, 95% CI [0.69, 4.25], t(500) = 2.72, p = 0.007; Std. beta = 0.50, 95% CI [0.14, 0.86])
##   - The effect of HMPbodysubsite [Hard palate] is statistically significant and positive (beta = 4.10, 95% CI [2.36, 5.84], t(500) = 4.63, p < .001; Std. beta = 0.83, 95% CI [0.48, 1.18])
##   - The effect of HMPbodysubsite [Left Retroauricular crease] is statistically significant and negative (beta = -2.96, 95% CI [-4.77, -1.15], t(500) = -3.22, p = 0.001; Std. beta = -0.60, 95% CI [-0.96, -0.23])
##   - The effect of HMPbodysubsite [Mid vagina] is statistically significant and negative (beta = -2.76, 95% CI [-4.45, -1.07], t(500) = -3.20, p = 0.001; Std. beta = -0.56, 95% CI [-0.90, -0.22])
##   - The effect of HMPbodysubsite [Palatine Tonsils] is statistically significant and positive (beta = 5.43, 95% CI [3.74, 7.12], t(500) = 6.32, p < .001; Std. beta = 1.10, 95% CI [0.76, 1.44])
##   - The effect of HMPbodysubsite [Posterior fornix] is statistically significant and negative (beta = -4.41, 95% CI [-6.15, -2.67], t(500) = -4.98, p < .001; Std. beta = -0.89, 95% CI [-1.24, -0.54])
##   - The effect of HMPbodysubsite [Right Retroauricular crease] is statistically significant and negative (beta = -3.18, 95% CI [-4.96, -1.40], t(500) = -3.51, p < .001; Std. beta = -0.64, 95% CI [-1.00, -0.28])
##   - The effect of HMPbodysubsite [Saliva] is statistically significant and positive (beta = 9.40, 95% CI [7.71, 11.09], t(500) = 10.93, p < .001; Std. beta = 1.90, 95% CI [1.56, 2.24])
##   - The effect of HMPbodysubsite [Stool] is statistically significant and positive (beta = 2.85, 95% CI [1.09, 4.61], t(500) = 3.18, p = 0.002; Std. beta = 0.58, 95% CI [0.22, 0.93])
##   - The effect of HMPbodysubsite [Subgingival plaque] is statistically significant and positive (beta = 9.36, 95% CI [7.69, 11.04], t(500) = 10.98, p < .001; Std. beta = 1.89, 95% CI [1.56, 2.23])
##   - The effect of HMPbodysubsite [Supragingival plaque] is statistically significant and positive (beta = 7.59, 95% CI [5.85, 9.33], t(500) = 8.57, p < .001; Std. beta = 1.54, 95% CI [1.18, 1.89])
##   - The effect of HMPbodysubsite [Throat] is statistically significant and positive (beta = 4.98, 95% CI [3.31, 6.66], t(500) = 5.84, p < .001; Std. beta = 1.01, 95% CI [0.67, 1.35])
##   - The effect of HMPbodysubsite [Tongue dorsum] is statistically significant and positive (beta = 2.91, 95% CI [1.19, 4.63], t(500) = 3.32, p < .001; Std. beta = 0.59, 95% CI [0.24, 0.94])
##   - The effect of HMPbodysubsite [Vaginal introitus] is statistically significant and negative (beta = -2.23, 95% CI [-3.94, -0.53], t(500) = -2.57, p = 0.010; Std. beta = -0.45, 95% CI [-0.80, -0.11])
##   - The interaction effect of HMPbodysubsite [Attached Keratinized gingiva] on sex [male] is statistically non-significant and positive (beta = 1.51, 95% CI [-0.88, 3.90], t(500) = 1.24, p = 0.217; Std. beta = 0.30, 95% CI [-0.18, 0.79])
##   - The interaction effect of HMPbodysubsite [Buccal mucosa] on sex [male] is statistically significant and positive (beta = 3.56, 95% CI [1.10, 6.03], t(500) = 2.84, p = 0.005; Std. beta = 0.72, 95% CI [0.22, 1.22])
##   - The interaction effect of HMPbodysubsite [Hard palate] on sex [male] is statistically significant and positive (beta = 3.08, 95% CI [0.57, 5.59], t(500) = 2.41, p = 0.016; Std. beta = 0.62, 95% CI [0.12, 1.13])
##   - The interaction effect of HMPbodysubsite [Left Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 1.12, 95% CI [-1.57, 3.82], t(500) = 0.82, p = 0.413; Std. beta = 0.23, 95% CI [-0.32, 0.77])
##   - The interaction effect of HMPbodysubsite [Mid vagina] on sex [male] is statistically non-significant and positive (beta = 1.32, 95% CI [-1.10, 3.73], t(500) = 1.07, p = 0.284; Std. beta = 0.27, 95% CI [-0.22, 0.75])
##   - The interaction effect of HMPbodysubsite [Palatine Tonsils] on sex [male] is statistically non-significant and positive (beta = 1.21, 95% CI [-1.37, 3.80], t(500) = 0.92, p = 0.356; Std. beta = 0.25, 95% CI [-0.28, 0.77])
##   - The interaction effect of HMPbodysubsite [Posterior fornix] on sex [male] is statistically non-significant and positive (beta = 2.02, 95% CI [-0.38, 4.42], t(500) = 1.65, p = 0.099; Std. beta = 0.41, 95% CI [-0.08, 0.89])
##   - The interaction effect of HMPbodysubsite [Right Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 1.69, 95% CI [-0.76, 4.14], t(500) = 1.35, p = 0.177; Std. beta = 0.34, 95% CI [-0.15, 0.84])
##   - The interaction effect of HMPbodysubsite [Saliva] on sex [male] is statistically non-significant and negative (beta = -0.25, 95% CI [-2.63, 2.13], t(500) = -0.21, p = 0.835; Std. beta = -0.05, 95% CI [-0.53, 0.43])
##   - The interaction effect of HMPbodysubsite [Stool] on sex [male] is statistically non-significant and positive (beta = 0.90, 95% CI [-1.53, 3.32], t(500) = 0.73, p = 0.467; Std. beta = 0.18, 95% CI [-0.31, 0.67])
##   - The interaction effect of HMPbodysubsite [Subgingival plaque] on sex [male] is statistically significant and positive (beta = 3.84, 95% CI [1.44, 6.24], t(500) = 3.14, p = 0.002; Std. beta = 0.78, 95% CI [0.29, 1.26])
##   - The interaction effect of HMPbodysubsite [Supragingival plaque] on sex [male] is statistically significant and positive (beta = 2.68, 95% CI [0.27, 5.09], t(500) = 2.18, p = 0.029; Std. beta = 0.54, 95% CI [0.05, 1.03])
##   - The interaction effect of HMPbodysubsite [Tongue dorsum] on sex [male] is statistically non-significant and negative (beta = -1.36, 95% CI [-3.26, 0.55], t(500) = -1.40, p = 0.163; Std. beta = -0.27, 95% CI [-0.66, 0.11])
##   - The interaction effect of HMPbodysubsite [Vaginal introitus] on sex [male] is statistically non-significant and negative (beta = -0.77, 95% CI [-2.44, 0.91], t(500) = -0.90, p = 0.368; Std. beta = -0.16, 95% CI [-0.49, 0.18])
## 
## Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using the Wald approximation.
## The ANOVA suggests that:
## 
##   - The main effect of sex is statistically significant and very small (F(1, 500) = 3.95, p = 0.047; Eta2 (partial) = 7.84e-03, 95% CI [4.65e-05, 1.00])
##   - The main effect of HMPbodysubsite is statistically significant and large (F(15, 500) = 110.86, p < .001; Eta2 (partial) = 0.77, 95% CI [0.74, 1.00])
##   - The interaction between sex and HMPbodysubsite is statistically significant and small (F(12, 500) = 2.55, p = 0.003; Eta2 (partial) = 0.06, 95% CI [0.01, 1.00])
## 
## Effect sizes were labelled following Field's (2013) recommendations.

8.4 Richness

## Anova Table (Type II tests)
## 
## Response: Alpha.Score
##                     Sum Sq  Df F value    Pr(>F)    
## sex                  57658   1  20.181 8.752e-06 ***
## HMPbodysubsite     3907814  15  91.185 < 2.2e-16 ***
## sex:HMPbodysubsite   70147  12   2.046   0.01906 *  
## Residuals          1434248 502                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## We fitted a linear model (estimated using OLS) to predict Alpha.Score with sex and HMPbodysubsite (formula: Alpha.Score ~ sex * HMPbodysubsite). The model explains a statistically significant and substantial proportion of variance (R2 = 0.75, F(28, 502) = 54.89, p < .001, adj. R2 = 0.74). The model's intercept, corresponding to sex = female and HMPbodysubsite = Anterior_nares, is at 254.36 (95% CI [222.70, 286.03], t(502) = 15.78, p < .001). Within this model:
## 
##   - The effect of sex [male] is statistically non-significant and positive (beta = 3.79, 95% CI [-39.23, 46.81], t(502) = 0.17, p = 0.863; Std. beta = 0.04, 95% CI [-0.37, 0.45])
##   - The effect of HMPbodysubsite [Attached Keratinized gingiva] is statistically non-significant and negative (beta = -19.36, 95% CI [-58.14, 19.42], t(502) = -0.98, p = 0.327; Std. beta = -0.18, 95% CI [-0.55, 0.19])
##   - The effect of HMPbodysubsite [Buccal mucosa] is statistically non-significant and negative (beta = -0.68, 95% CI [-41.81, 40.46], t(502) = -0.03, p = 0.974; Std. beta = -6.45e-03, 95% CI [-0.40, 0.39])
##   - The effect of HMPbodysubsite [Hard palate] is statistically non-significant and positive (beta = 32.40, 95% CI [-8.24, 73.04], t(502) = 1.57, p = 0.118; Std. beta = 0.31, 95% CI [-0.08, 0.70])
##   - The effect of HMPbodysubsite [Left Retroauricular crease] is statistically significant and negative (beta = -92.16, 95% CI [-133.85, -50.48], t(502) = -4.34, p < .001; Std. beta = -0.88, 95% CI [-1.28, -0.48])
##   - The effect of HMPbodysubsite [Mid vagina] is statistically significant and negative (beta = -88.91, 95% CI [-127.69, -50.13], t(502) = -4.50, p < .001; Std. beta = -0.85, 95% CI [-1.22, -0.48])
##   - The effect of HMPbodysubsite [Palatine Tonsils] is statistically significant and positive (beta = 107.49, 95% CI [68.41, 146.58], t(502) = 5.40, p < .001; Std. beta = 1.03, 95% CI [0.65, 1.40])
##   - The effect of HMPbodysubsite [Posterior fornix] is statistically significant and negative (beta = -107.09, 95% CI [-147.28, -66.90], t(502) = -5.23, p < .001; Std. beta = -1.02, 95% CI [-1.40, -0.64])
##   - The effect of HMPbodysubsite [Right Retroauricular crease] is statistically significant and negative (beta = -76.13, 95% CI [-116.76, -35.49], t(502) = -3.68, p < .001; Std. beta = -0.73, 95% CI [-1.11, -0.34])
##   - The effect of HMPbodysubsite [Saliva] is statistically significant and positive (beta = 175.97, 95% CI [136.88, 215.06], t(502) = 8.85, p < .001; Std. beta = 1.68, 95% CI [1.31, 2.05])
##   - The effect of HMPbodysubsite [Stool] is statistically significant and positive (beta = 54.53, 95% CI [14.33, 94.72], t(502) = 2.67, p = 0.008; Std. beta = 0.52, 95% CI [0.14, 0.90])
##   - The effect of HMPbodysubsite [Subgingival plaque] is statistically significant and positive (beta = 147.38, 95% CI [108.88, 185.87], t(502) = 7.52, p < .001; Std. beta = 1.41, 95% CI [1.04, 1.77])
##   - The effect of HMPbodysubsite [Supragingival plaque] is statistically significant and positive (beta = 146.53, 95% CI [106.74, 186.32], t(502) = 7.24, p < .001; Std. beta = 1.40, 95% CI [1.02, 1.78])
##   - The effect of HMPbodysubsite [Throat] is statistically significant and positive (beta = 108.00, 95% CI [69.22, 146.78], t(502) = 5.47, p < .001; Std. beta = 1.03, 95% CI [0.66, 1.40])
##   - The effect of HMPbodysubsite [Tongue dorsum] is statistically significant and positive (beta = 53.69, 95% CI [13.90, 93.48], t(502) = 2.65, p = 0.008; Std. beta = 0.51, 95% CI [0.13, 0.89])
##   - The effect of HMPbodysubsite [Vaginal introitus] is statistically significant and negative (beta = -86.41, 95% CI [-125.50, -47.32], t(502) = -4.34, p < .001; Std. beta = -0.82, 95% CI [-1.20, -0.45])
##   - The interaction effect of HMPbodysubsite [Attached Keratinized gingiva] on sex [male] is statistically non-significant and positive (beta = 14.59, 95% CI [-39.05, 68.23], t(502) = 0.53, p = 0.593; Std. beta = 0.14, 95% CI [-0.37, 0.65])
##   - The interaction effect of HMPbodysubsite [Buccal mucosa] on sex [male] is statistically non-significant and positive (beta = 54.27, 95% CI [-1.33, 109.87], t(502) = 1.92, p = 0.056; Std. beta = 0.52, 95% CI [-0.01, 1.05])
##   - The interaction effect of HMPbodysubsite [Hard palate] on sex [male] is statistically significant and positive (beta = 78.83, 95% CI [20.97, 136.69], t(502) = 2.68, p = 0.008; Std. beta = 0.75, 95% CI [0.20, 1.30])
##   - The interaction effect of HMPbodysubsite [Left Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 26.41, 95% CI [-34.33, 87.15], t(502) = 0.85, p = 0.393; Std. beta = 0.25, 95% CI [-0.33, 0.83])
##   - The interaction effect of HMPbodysubsite [Mid vagina] on sex [male] is statistically non-significant and negative (beta = -2.55, 95% CI [-56.42, 51.31], t(502) = -0.09, p = 0.926; Std. beta = -0.02, 95% CI [-0.54, 0.49])
##   - The interaction effect of HMPbodysubsite [Palatine Tonsils] on sex [male] is statistically non-significant and positive (beta = 0.67, 95% CI [-57.20, 58.53], t(502) = 0.02, p = 0.982; Std. beta = 6.36e-03, 95% CI [-0.55, 0.56])
##   - The interaction effect of HMPbodysubsite [Posterior fornix] on sex [male] is statistically non-significant and positive (beta = 8.93, 95% CI [-45.18, 63.03], t(502) = 0.32, p = 0.746; Std. beta = 0.09, 95% CI [-0.43, 0.60])
##   - The interaction effect of HMPbodysubsite [Right Retroauricular crease] on sex [male] is statistically non-significant and positive (beta = 17.38, 95% CI [-38.41, 73.17], t(502) = 0.61, p = 0.541; Std. beta = 0.17, 95% CI [-0.37, 0.70])
##   - The interaction effect of HMPbodysubsite [Saliva] on sex [male] is statistically non-significant and negative (beta = -12.91, 95% CI [-66.35, 40.53], t(502) = -0.47, p = 0.635; Std. beta = -0.12, 95% CI [-0.63, 0.39])
##   - The interaction effect of HMPbodysubsite [Stool] on sex [male] is statistically non-significant and negative (beta = -2.59, 95% CI [-56.96, 51.78], t(502) = -0.09, p = 0.925; Std. beta = -0.02, 95% CI [-0.54, 0.49])
##   - The interaction effect of HMPbodysubsite [Subgingival plaque] on sex [male] is statistically non-significant and positive (beta = 35.48, 95% CI [-18.68, 89.63], t(502) = 1.29, p = 0.199; Std. beta = 0.34, 95% CI [-0.18, 0.85])
##   - The interaction effect of HMPbodysubsite [Supragingival plaque] on sex [male] is statistically non-significant and positive (beta = 36.71, 95% CI [-17.91, 91.32], t(502) = 1.32, p = 0.187; Std. beta = 0.35, 95% CI [-0.17, 0.87])
##   - The interaction effect of HMPbodysubsite [Tongue dorsum] on sex [male] is statistically non-significant and positive (beta = 3.79, 95% CI [-39.23, 46.81], t(502) = 0.17, p = 0.863; Std. beta = 0.04, 95% CI [-0.37, 0.45])
##   - The interaction effect of HMPbodysubsite [Vaginal introitus] on sex [male] is statistically non-significant and negative (beta = -19.36, 95% CI [-58.14, 19.42], t(502) = -0.98, p = 0.327; Std. beta = -0.18, 95% CI [-0.55, 0.19])
## 
## Standardized parameters were obtained by fitting the model on a standardized version of the dataset. 95% Confidence Intervals (CIs) and p-values were computed using the Wald approximation.
## The ANOVA suggests that:
## 
##   - The main effect of sex is statistically significant and small (F(1, 502) = 20.18, p < .001; Eta2 (partial) = 0.04, 95% CI [0.02, 1.00])
##   - The main effect of HMPbodysubsite is statistically significant and large (F(15, 502) = 91.18, p < .001; Eta2 (partial) = 0.73, 95% CI [0.70, 1.00])
##   - The interaction between sex and HMPbodysubsite is statistically significant and small (F(12, 502) = 2.05, p = 0.019; Eta2 (partial) = 0.05, 95% CI [3.82e-03, 1.00])
## 
## Effect sizes were labelled following Field's (2013) recommendations.

9 Plots

## $Shannon

## 
## $Simpson

## 
## $Phylogenetic

## 
## $Richness